package com.aldd.service.Impl;

import com.aldd.entity.Dept;
import com.aldd.mapper.DeptMapper;
import com.aldd.service.DeptService;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Data
@Service
public class DeptServiceImpl implements DeptService {
    @Autowired
    private DeptMapper deptMapper;

    @Override
    public List<Dept> selectAllDept() {
        return deptMapper.selectAllDept();
    }

    @Override
    public Dept selectDeptById(int id) {
        return deptMapper.selectDeptById(id);
    }

    @Override
    public Boolean deleteDeptById(int id) {
        return deptMapper.deleteDeptById(id) > 0;
    }

    @Override
    public void insertDept(Dept dept) {
        deptMapper.insertDept(dept);
    }

    @Override
    public void updateDept(Dept dept) {
        deptMapper.updateDept(dept);
    }
}
